package reittiopas;

import java.util.Vector;

/**
*
* @author Jaakko, Petteri
*/

public class Route {

    private Vector subRoutes;
    private Location startLocation;
    private Location destinationLocation;
    private String totalTime;
    private String totalDistance;
//   
    private String totalWalkingDistance = null;

	public Route() {
        this.subRoutes = new Vector();
    }


	public Location getStartLocation() {
		return startLocation;
	}


	public void setStartLocation(Location startLocation) {
		this.startLocation = startLocation;
	}


	public Location getDestinationLocation() {
		return destinationLocation;
	}



	public void setDestinationLocation(Location destinationLocation) {
		this.destinationLocation = destinationLocation;
	}


//    public String getTotalWalkingDistance() {
//    	if(totalWalkingDistance != null)
//    		return totalWalkingDistance;
//    	Vector subs = this.getSubRoutes();
//    	
//    	for (int i = 0; i < subs.size(); i++) {
//    		
//    	}
//    	return "";
//	}


	public String getTotalDistance() {
		return totalDistance;
	}



	public void setTotalDistance(String totalDistance) {
		this.totalDistance = totalDistance;
	}



	public void setTotalTime(String time) {
    	this.totalTime = time;
    }
    
    public String getTotalTime() {
    	return this.totalTime;
    }
    

    public void addSubRoute(SubRoute subRoute) {
        this.subRoutes.addElement(subRoute);
    }

    public Vector getSubRoutes() {
        return subRoutes;
    }

    public void setSubRoutes(Vector subRoutes) {
        this.subRoutes = subRoutes;
    }
    
    public String toString() {
    	String description = "";
    	description += "Duration: " + this.getTotalTime() + " Distance: " + this.getTotalDistance() + "\n";
    	//description += "" + this.getStartLocation().getDepartureTime() + " " +  this.getStartLocation().getAddress() + "\n";
    	//description += "" + this.getDestinationLocation().getDepartureTime() + " " +  this.getDestinationLocation().getAddress() + "\n";
    	
    	return description;
    }
    
    
}
